#include <stdio.h>

int findMax(int *arr, int size)
{
    int *p = arr;
    int max = 0;
    int i = 0; 
    for(i = 0; i < size; i++)
    {
        if(max < *p)  //p[i]
        {
            max = *p;
        }
        p++;
    }

    return max;
}

int main()
{
    int arr[5] = {1, 2, 3, 4, 5};
    int size = sizeof(arr)/sizeof(arr[0]);
    int max = findMax(arr, size);

    printf("max = %d\n", max);

    return 0;
}